package com.dkm.orproject.utils.jwt.intertfaceceptor.domain;

import lombok.Data;


/**
 * @PROJECT_NAME: orproject
 * @DESCRIPTION:
 * @USER: 周佳佳
 * @DATE: 2020/7/24 9:27
 */
//这里可继承你需要定义的错误
@Data
public class CustomException extends RuntimeException{

    //可以用来接受我们方法中传的参数
    private int code;
    private String msg;
    private int httpStatus;

    /**
     * 有两个构造方法 必须留一个空的
     */
    public CustomException() {
        super();
    }
    /**
     * 默认返回异常~
     * @param code
     */
    public CustomException(Code code) {
        this.code = code.getCode();
        this.msg = code.getMsg();
        this.httpStatus = code.getHttpStatus();
    }
    public CustomException(Code code,String msg) {
        //super("Token异常,请重新登录");
        this.code =code.getCode();
        this.httpStatus =  code.getHttpStatus();
        this.msg=msg;
    }

}
